package com.tyk.bookstore.front.product.model.vo;


import com.tyk.bookstore.front.common.core.model.vo.PageVo;
import com.tyk.bookstore.front.common.core.util.FileUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author tyk
 * @description 收藏分页查询展示Vo
 */
public class BookPageVo extends PageVo<BookPageVo.Book> {
    @Data
    public static class Book {

        @Schema(description = "ID")
        private Long id;

        @Schema(description = "书名")
        private String name;

        @Schema(description = "标题")
        private String title;

        @Schema(description = "封面路径")
        private String cover;

        @Schema(description = "价格")
        private BigDecimal price;

        @Schema(description = "出版社名称")
        private String publisherName;

        @Schema(description = "收藏人数")
        private String collectNum;

        @Schema(description = "销量")
        private String saleNum;

        @Schema(description = "购买人数")
        private String payNum;

        @Schema(description = "评论人数")
        private String commentNum;

        @Schema(description = "点赞人数")
        private String likeNum;

        @Schema(description = "是否收藏")
        private Boolean collected;

        @Schema(description = "是否点赞")
        private Boolean praised;

        public Book setCover(String cover) {
            this.cover = FileUtil.fullFilePath(cover);
            return this;
        }
    }
}
